package tushare

import (
	"tushare/model"
	"tushare/model/tushare"
)

type Analyse struct{}

func (a Analyse) Percent() {
	stocks := model.StockList()
	for _, v := range stocks {
		dailyList := tushare.DailyRowsByLimt(10000, v.TsCode)

		for _, item := range dailyList {
			low := (item.Low - item.PreClose) / item.PreClose * 100
			heigh := (item.High - item.PreClose) / item.PreClose * 100

			aa := tushare.AnalyseActive{}
			aa.TsCode = v.TsCode
			aa.LowPercent = low
			aa.HighPercent = heigh
			aa.TradeDate = item.TradeDate
			tushare.AnalyseActiveCreate(aa)
		}
	}
}
